<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>회원가입</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<script type="text/javascript" src="jquery.ui.datepicker-ko.js"></script>
<script type="text/javascript">
    
    
    $(document).ready(function() {

    $("#btn_join").click(function(){
    	$.ajax({
    		url:" ",
    		type:"post",
    		data :{"id":$("#id").val()},
    		success:function(data,status,xhr){
    			data=$.parseJSON(data);
    			var result=data.result;
    			alert(result);
    			
    			if(result=="true"){
    				alert("가입 가능한 ID 입니다.");
    			}else if(result=="false"){
    				alert("이미 가입된 ID가 있습니다.");
    			}
    		},
    		error:function(xhr,status,error){
    			alert("error\nxhr:"+xhr+",status:"+status+",error:"+error);
    		}
    	});
    	alert('통신성공');
    });

    var pickerOpts = {  

    		    changeMonth: true,  

    		        changeYear: true  

    	    };    
       $("#birth").datepicker(pickerOpts);
    });
	
</script>
</head>
<body>
<h1>회원 가입</h1>


<form action="../membership/join.do" method="post">
<table id="jointable">
	<tr>
		<th>아이디</th>
		<td><input type="text" name="id" id="id" size="12" maxlength="12" />
		  <input type="button" name="id" value="ID중복확인" onclick="" /> 
		
		</td>
	</tr>
	<tr>
		<th>비밀번호</th>
		<td><input type="password" name="pwd" id="pwd" size="12" maxlength="12" /></td>
	</tr>
	<tr>
		<th>비밀번호확인</th>
		<td><input type="password" name="pwd2" id="pwd2" size="12" maxlength="12" /></td>
	</tr>
	<tr>
		<th>이름</th>
		<td><input type="text" name="name" id="name" size="12" maxlength="12" /></td>
	</tr>
	
	<tr>
		<th>이메일</th>
		<td><input type="text" name="email" id="email" size="30" maxlength="30" /></td>
	</tr>
	
	<tr>
		<th>성별</th>
		<td>
			<input type="radio" id="man" name="gender" value="M" checked="checked" >남자
			<input type="radio" id="woman" name="gender" value="W">여자
		</td>
	</tr>
	
	<tr>
		<th>생일</th>
		<td>
		
		<input type="text" id="birth" size="8" maxlength="8" />
			
		
		</td>
	</tr>

	<tr>
		
		<td colspan="2">
			<input type="submit" id="btn_join" value="가입" >
			<input type="reset" id="btn_cancel" value="취소" onclick="window.close()">	
		</td>
	</tr>
</table>


</form>

</body>
</html>